package cn.silver.module.authority.domain;

import cn.silver.framework.core.utils.DateUtils;
import cn.silver.framework.mybatis.annotation.Table;
import cn.silver.framework.mybatis.annotation.TableField;
import cn.silver.framework.mybatis.enums.SearchTypeEnums;
import cn.silver.framework.mybatis.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.util.Date;

/**
 * 租户成员对象 sys_tenant_user
 *
 * @author Silver Zhou
 */
@Data
@NoArgsConstructor
@Table(name = "sys_tenant_user")
@EqualsAndHashCode(callSuper = true)
@Schema(name = "SysTenantUser", title = "租户成员对象", description = "租户成员信息")
public class SysTenantUser extends BaseEntity {

    @Serial
    private static final long serialVersionUID = 1L;
    @Schema(title = "租户套餐ID")
    @TableField(name = "group_id", searchType = SearchTypeEnums.EQ)
    private String groupId;
    @Schema(title = "所属组织")
    @TableField(name = "dept_id", searchType = SearchTypeEnums.EQ)
    private String deptId;
    @Schema(title = "任职岗位")
    @TableField(name = "post_id", searchType = SearchTypeEnums.EQ)
    private String postId;
    @Schema(title = "成员信息")
    @TableField(name = "user_id", searchType = SearchTypeEnums.EQ)
    private String userId;
    @Schema(title = "成员类型")
    @TableField(name = "user_type", searchType = SearchTypeEnums.EQ)
    private String userType;
    @Schema(title = "注册时间")
    @TableField(name = "start_time", searchType = SearchTypeEnums.EQ)
    @JsonFormat(timezone = DateUtils.TIME_ZONE, pattern = DateUtils.YYYY_MM_DD)
    private Date startTime;
    @Schema(title = "失效时间")
    @JsonFormat(timezone = DateUtils.TIME_ZONE, pattern = DateUtils.YYYY_MM_DD)
    private Date stopTime;
    @Schema(title = "成员状态")
    @TableField(name = "status", searchType = SearchTypeEnums.EQ)
    private String status;
}
